home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / tsbat30.zip / safedel.bat < prev    next >
DOS Batch File  |  1990-12-28  |  2KB  |  60 lines

  1. echo off
  2. echo.
  3. echo ┌───────────────────────────────────────────────────┐
  4. echo │ Safe delete of files                              │
  5. echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, 28-Dec-90 │
  6. echo └───────────────────────────────────────────────────┘
  7. echo.
  8.  
  9. if "%1"=="" goto _help
  10.  
  11. rem Check that safedel1.bat is available at path
  12. set _found=no
  13. if exist safedel1.bat set _found=yes
  14. for %%d in (%path%) do if exist %%d\safedel1.bat set _found=yes
  15. if "%_found%"=="no" goto _err1
  16.  
  17. rem Check that ask.exe is available at path
  18. set _found=no
  19. if exist ask.exe set _found=yes
  20. for %%d in (%path%) do if exist %%d\ask.exe set _found=yes
  21. if "%_found%"=="no" goto _err2
  22.  
  23. rem Handle the files
  24. :_loop
  25. if not exist %1 goto _err3
  26. rem for MsDos earlier than 3.3 move the rem below one command downwards
  27. rem for %%f in (%1) do %comspec% /e:1024 /c safedel1 %%f
  28. for %%f in (%1) do call safedel1 %%f
  29. shift
  30. if not "%1"=="" goto _loop
  31. goto _out
  32.  
  33. :_err1
  34. echo You must have safedel1.bat at your path (or the current directory)
  35. goto _out
  36.  
  37. :_err2
  38. echo You must have ask.exe at your path (or the current directory)
  39. goto _out
  40.  
  41. :_err3
  42. echo File(s) %1 not found
  43. goto _out
  44.  
  45. :_help
  46. echo Usage: SAFEDEL [FileName1] [FileName2] [FileName3] ...
  47. echo.
  48. echo Wildcards are allowed in the file names.
  49. echo.
  50. echo If you get an "Out of environment space" message, increase your
  51. echo environment space by using shell configuration in config.sys:
  52. echo MsDos 3.30 example: shell=c:\bin\command.com /e:1024 /p
  53. echo.
  54. echo To use this batch you need ask.exe and safedel1.bat either at
  55. echo your path or the current directory.
  56. echo.
  57.  
  58. :_out
  59. echo on
  60.